﻿/*
 *	(*^。^*) TFrameWork License (*^。^*)
 */

/*
 *  Title :
 *
 *  Description :
 *
 *
 *  Date :
 *
 *  Author : DengPing
 *
 *  Modify :
 */

using UnityEditor;
using UnityEngine;

namespace TFrameWork.Module.ActionEditor
{
    public static class TUndo
    {
        public static void RecordObject(Object obj,string descript)
        {
            if (!ActionEditor.Instance.isRedo)
            {
                Undo.RecordObject(obj, descript);     
            }
        }

        public static void RegisterCreatedObjectUndo(Object obj, string descript)
        {
            if (!ActionEditor.Instance.isRedo) 
            {
                Undo.RegisterCreatedObjectUndo(obj, descript);
            }

        }

        public static void DestroyObjectImmediate(Object obj)
        {
            if (!ActionEditor.Instance.isRedo)
            {
                Undo.DestroyObjectImmediate(obj);
            }
        }
    }
}
